package com.easemob.exceptions;

import java.io.IOException;
import java.net.ConnectException;
import java.net.NoRouteToHostException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import org.jivesoftware.smack.XMPPException;

public class EMExceptionUtils
{
  public static int fromExceptionToErrorCode(Exception paramException)
  {
    int i = -999;
    if ((paramException instanceof UnknownHostException))
      i = -1002;
    else if ((paramException instanceof NoRouteToHostException))
      i = -1003;
    else if ((paramException instanceof ConnectException))
      i = -1003;
    else if ((paramException instanceof SocketException))
      i = -1003;
    else if ((paramException instanceof SocketTimeoutException))
      i = -1004;
    else if ((paramException instanceof EMAuthenticationException))
      i = -1005;
    else if ((paramException instanceof KeyStoreException))
      i = -1006;
    else if ((paramException instanceof IOException))
      i = -1007;
    else if ((paramException instanceof CertificateException))
      i = -1008;
    else if ((paramException instanceof NoSuchAlgorithmException))
      i = -1009;
    else if ((paramException instanceof UnrecoverableKeyException))
      i = -1009;
    else if ((paramException instanceof KeyManagementException))
      i = -1009;
    else if (paramException.getMessage().contains("User removed"))
      i = -1023;
    else if (paramException.getMessage().contains("conflict"))
      i = -1014;
    else if ((paramException instanceof XMPPException))
    {
      if (paramException.getMessage().contains("Not connected to server"))
        i = -1003;
    }
    else if (((paramException instanceof XMPPException)) && (paramException.getMessage().contains("No response")))
      i = -1003;
    return i;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     com.easemob.exceptions.EMExceptionUtils
 * JD-Core Version:    0.6.1
 */